{% extends "base_dialog.html" %}

{% block content %}
    {% if question %}
        <div class="tip">Задача:</div>
        <div class="quest">{{ question.text|linebreaksbr }}</div><br>
    {% endif %}
    <h2 style="margin-top: 0px;margin-bottom: 4px;">{% if answers %}Отметь возможные решения{% else %}Добавить первое решение?
    {% endif %}</h2>
    <form action="/quest?id={{ question.key }}&rnd={{ rnd }}" method="post">

        {% for answer in answers %}
            <div class="state">{{ answer.text|escape }}
            </div>
            <fieldset>

                <div class="indent" style="margin-top: 5px" data-role="controlgroup" data-type="horizontal">

                    <input type="radio"
                           name="{{ answer.key }}"
                           value="void"
                           id="void"
                           checked="yes"/>
                    <label for="void" class="ui-btn">...</label>
                    <input type="radio"
                           name="{{ answer.key }}"
                           value="like"
                           id="like"/>
                    <label for="like" class="ui-btn"><font color="green">Да</font></label>
                    <input type="radio"
                           name="{{ answer.key }}"
                           value="bad"
                           id="bad"/>
                    <label for="bad" class="ui-btn"><font color="red">Нет</font></label>
                </div>
                &nbsp;<span class="tip">не подходит или спам</span>
            </fieldset>
            <br>
        {% endfor %}
        {% if answers %}
            <input type="submit"
                   value="Готово"
                   data-theme="b"
                   data-inline="true"
                   data-icon="check">
            <a data-role="button"
               data-icon="plus"
               data-inline="true"
               href='/new?type=answer&id={{ question.key }}&rnd={{ rnd }}'>Новое решение</a>


        {% else %}
            <input type="submit"
                   value="Нет, спасибо"
                   data-theme="b"
                   data-inline="true"
                   data-icon="arrow-r">
            <a data-role="button"
               data-icon="plus"
               data-inline="true"
               href='/new?type=answer&id={{ question.key }}&rnd={{ rnd }}'>Новое решение</a>

        {% endif %}
    </form>
{% endblock %}